//package com.amt.olcacon.config;
//
//import javax.sql.DataSource;
//
//import org.apache.ibatis.session.SqlSessionFactory;
//import org.mybatis.spring.SqlSessionFactoryBean;
//import org.mybatis.spring.annotation.MapperScan;
//import org.springframework.beans.factory.annotation.Qualifier;
//import org.springframework.boot.context.properties.ConfigurationProperties;
//import org.springframework.boot.jdbc.DataSourceBuilder;
//import org.springframework.context.annotation.Bean;
//import org.springframework.context.annotation.Configuration;
//import org.springframework.jdbc.core.JdbcTemplate;
//
//@Configuration
//@MapperScan(basePackages = "com.amt.olcacon.mapper", sqlSessionFactoryRef = "derbySqlSessionFactory")
//public class DerbyDataSourceConfig {
//
//    @Bean(name = "derbyDataSource")
//    @ConfigurationProperties(prefix = "spring.datasource.derby")
//    public DataSource derbyDataSource() {
//        return DataSourceBuilder.create().build();
//    }
//
//    @Bean(name = "derbySqlSessionFactory")
//    public SqlSessionFactory derbySqlSessionFactory(@Qualifier("derbyDataSource") DataSource dataSource) throws Exception {
//        SqlSessionFactoryBean factoryBean = new SqlSessionFactoryBean();
//        factoryBean.setDataSource(dataSource);
//        return factoryBean.getObject();
//    }
//
//    @Bean(name = "derbyJdbcTemplate")
//    public JdbcTemplate derbyJdbcTemplate(@Qualifier("derbyDataSource") DataSource dataSource) {
//        return new JdbcTemplate(dataSource);
//    }
//}